﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;
using System.Reflection;
using System.Data;

namespace COMPONENT.Library.General
{
    //reflection pattern
    public static class clsExtension
    {
        public static T GetSession<T>(string nombresesion)
        {
            T obj = default(T);
            try
            {
                if (HttpContext.Current != null)
                {
                    obj = (T)HttpContext.Current.Session[nombresesion];
                }
            }
            catch (Exception ex)
            {
                obj = default(T);
            }
            return (T)obj;
        }
    }
}
